﻿CREATE TABLE [dbo].[ProcessDefinitionGroups]
(
	[ProcessDefinitionGroupId] BIGINT NOT NULL PRIMARY KEY, 
    [GroupName] NVARCHAR(250) NOT NULL, 
    [GroupDescription] NVARCHAR(1000) NOT NULL, 
    [ParentGroupId] BIGINT NULL, 
    [ApplicationId] BIGINT NOT NULL, 
    CONSTRAINT [FK_ProcessDefinitionGroups_ToProcessDefinitionGroups] FOREIGN KEY ([ParentGroupId]) REFERENCES [dbo].[ProcessDefinitionGroups]([ProcessDefinitionGroupId]), 
    CONSTRAINT [FK_ProcessDefinitionGroups_ToApplications] FOREIGN KEY ([ApplicationId]) REFERENCES  [dbo].[Applications]([ApplicationId])
)
